{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Naive Bayes - Trabalho\n",
    "\n",
    "## Questão 1\n",
    "\n",
    "Implemente um classifacor Naive Bayes para o problema de predizer a qualidade de um carro. Para este fim, utilizaremos um conjunto de dados referente a qualidade de carros, disponível no [UCI](https://archive.ics.uci.edu/ml/datasets/car+evaluation). Este dataset de carros possui as seguintes features e classe:\n",
    "\n",
    "** Attributos **\n",
    "1. buying: vhigh, high, med, low\n",
    "2. maint: vhigh, high, med, low\n",
    "3. doors: 2, 3, 4, 5, more\n",
    "4. persons: 2, 4, more\n",
    "5. lug_boot: small, med, big\n",
    "6. safety: low, med, high\n",
    "\n",
    "** Classes **\n",
    "1. unacc, acc, good, vgood\n",
    "\n",
    "## Questão 2\n",
    "Crie uma versão de sua implementação usando as funções disponíveis na biblioteca SciKitLearn para o Naive Bayes ([veja aqui](http://scikit-learn.org/stable/modules/naive_bayes.html)) \n",
    "\n",
    "## Questão 3\n",
    "\n",
    "Analise a acurácia dos dois algoritmos e discuta a sua solução."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/home/bruno/miniconda3/envs/spark/lib/python3.6/site-packages/sklearn/cross_validation.py:41: DeprecationWarning: This module was deprecated in version 0.18 in favor of the model_selection module into which all the refactored classes and functions are moved. Also note that the interface of the new CV iterators are different from that of this module. This module will be removed in 0.20.\n",
      "  \"This module will be removed in 0.20.\", DeprecationWarning)\n"
     ]
    }
   ],
   "source": [
    "import pandas as pd\n",
    "import sklearn as skt\n",
    "from sklearn.preprocessing import LabelEncoder\n",
    "from sklearn.cross_validation import train_test_split"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "  buying  maint doors persons lug_boot safety  class\n",
      "0  vhigh  vhigh     2       2    small    low  unacc\n",
      "1  vhigh  vhigh     2       2    small    med  unacc\n",
      "2  vhigh  vhigh     2       2    small   high  unacc\n",
      "3  vhigh  vhigh     2       2      med    low  unacc\n",
      "4  vhigh  vhigh     2       2      med    med  unacc\n"
     ]
    }
   ],
   "source": [
    "columns = ['buying','maint','doors','persons','lug_boot','safety','class']\n",
    "dataset = pd.read_csv('carData.csv' , header = None, names = columns, index_col=False)\n",
    "print(dataset.head())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [],
   "source": [
    "for i in range(0, dataset.shape[1]):\n",
    "    dataset.iloc[:,i] = LabelEncoder().fit_transform(dataset.iloc[:,i])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<bound method NDFrame.head of       buying  maint  doors  persons  lug_boot  safety  class\n",
       "0          3      3      0        0         2       1      2\n",
       "1          3      3      0        0         2       2      2\n",
       "2          3      3      0        0         2       0      2\n",
       "3          3      3      0        0         1       1      2\n",
       "4          3      3      0        0         1       2      2\n",
       "5          3      3      0        0         1       0      2\n",
       "6          3      3      0        0         0       1      2\n",
       "7          3      3      0        0         0       2      2\n",
       "8          3      3      0        0         0       0      2\n",
       "9          3      3      0        1         2       1      2\n",
       "10         3      3      0        1         2       2      2\n",
       "11         3      3      0        1         2       0      2\n",
       "12         3      3      0        1         1       1      2\n",
       "13         3      3      0        1         1       2      2\n",
       "14         3      3      0        1         1       0      2\n",
       "15         3      3      0        1         0       1      2\n",
       "16         3      3      0        1         0       2      2\n",
       "17         3      3      0        1         0       0      2\n",
       "18         3      3      0        2         2       1      2\n",
       "19         3      3      0        2         2       2      2\n",
       "20         3      3      0        2         2       0      2\n",
       "21         3      3      0        2         1       1      2\n",
       "22         3      3      0        2         1       2      2\n",
       "23         3      3      0        2         1       0      2\n",
       "24         3      3      0        2         0       1      2\n",
       "25         3      3      0        2         0       2      2\n",
       "26         3      3      0        2         0       0      2\n",
       "27         3      3      1        0         2       1      2\n",
       "28         3      3      1        0         2       2      2\n",
       "29         3      3      1        0         2       0      2\n",
       "...      ...    ...    ...      ...       ...     ...    ...\n",
       "1698       1      1      2        2         0       1      2\n",
       "1699       1      1      2        2         0       2      1\n",
       "1700       1      1      2        2         0       0      3\n",
       "1701       1      1      3        0         2       1      2\n",
       "1702       1      1      3        0         2       2      2\n",
       "1703       1      1      3        0         2       0      2\n",
       "1704       1      1      3        0         1       1      2\n",
       "1705       1      1      3        0         1       2      2\n",
       "1706       1      1      3        0         1       0      2\n",
       "1707       1      1      3        0         0       1      2\n",
       "1708       1      1      3        0         0       2      2\n",
       "1709       1      1      3        0         0       0      2\n",
       "1710       1      1      3        1         2       1      2\n",
       "1711       1      1      3        1         2       2      0\n",
       "1712       1      1      3        1         2       0      1\n",
       "1713       1      1      3        1         1       1      2\n",
       "1714       1      1      3        1         1       2      1\n",
       "1715       1      1      3        1         1       0      3\n",
       "1716       1      1      3        1         0       1      2\n",
       "1717       1      1      3        1         0       2      1\n",
       "1718       1      1      3        1         0       0      3\n",
       "1719       1      1      3        2         2       1      2\n",
       "1720       1      1      3        2         2       2      0\n",
       "1721       1      1      3        2         2       0      1\n",
       "1722       1      1      3        2         1       1      2\n",
       "1723       1      1      3        2         1       2      1\n",
       "1724       1      1      3        2         1       0      3\n",
       "1725       1      1      3        2         0       1      2\n",
       "1726       1      1      3        2         0       2      1\n",
       "1727       1      1      3        2         0       0      3\n",
       "\n",
       "[1728 rows x 7 columns]>"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dataset.head"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [],
   "source": [
    "X_train, X_test, y_train, y_test = train_test_split(dataset.iloc[:,:-1], dataset.iloc[:,-1], test_size=0.2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "MultinomialNB(alpha=1.0, class_prior=None, fit_prior=True)"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from sklearn.naive_bayes import MultinomialNB, GaussianNB\n",
    "#Implementação do sklearn\n",
    "mult = MultinomialNB()\n",
    "mult.fit(X_train.values,y_train.values)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [],
   "source": [
    "pred = mult.predict(X_test.values)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2\n",
      " 2 2 2 2 2 2 2 2 2 2 0 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2\n",
      " 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2\n",
      " 2 2 2 2 2 2 2 2 2 0 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2\n",
      " 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 0 2 2 2 2 2\n",
      " 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2\n",
      " 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2\n",
      " 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2\n",
      " 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2\n",
      " 2 2 2 2 2 2 2 2 2 2 2 2 2]\n"
     ]
    }
   ],
   "source": [
    "print(pred)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.metrics import accuracy_score, classification_report"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0.722543352601\n"
     ]
    }
   ],
   "source": [
    "print(accuracy_score(y_true = y_test,y_pred = pred))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import csv\n",
    " \n",
    "def loadCsv(filename):\n",
    "    lines = csv.reader(open(filename, \"r\"))\n",
    "    dataset = list(lines)\n",
    "    for i in range(len(dataset)):\n",
    "        dataset[i] = [x for x in dataset[i]]\n",
    "    return dataset\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "data = loadCsv('carData.csv')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "import random\n",
    "def splitDataset(dataset, splitRatio):\n",
    "    trainSize = int(len(dataset) * splitRatio)\n",
    "    trainSet = []\n",
    "    copy = list(dataset)\n",
    "    while len(trainSet) < trainSize:\n",
    "        index = random.randrange(len(copy))\n",
    "        trainSet.append(copy.pop(index))\n",
    "    return [trainSet, copy]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "import math\n",
    "import csv\n",
    " \n",
    "def loadCsv(filename):\n",
    "    lines = csv.reader(open(filename, \"r\"))\n",
    "    dataset = list(lines)\n",
    "    for i in range(len(dataset)):\n",
    "        dataset[i] = [float(x) for x in dataset[i]]\n",
    "    return dataset\n",
    "\n",
    "def separateByClass(dataset):\n",
    "    separated = {}\n",
    "    for i in range(len(dataset)):\n",
    "        vector = dataset[i]\n",
    "        if (vector[-1] not in separated):\n",
    "            separated[vector[-1]] = []\n",
    "        separated[vector[-1]].append(vector)\n",
    "    return separated\n",
    "\n",
    "def mean(numbers):\n",
    "    return sum(numbers)/float(len(numbers))\n",
    " \n",
    "def stdev(numbers):\n",
    "    avg = mean(numbers)\n",
    "    variance = sum([pow(x-avg,2) for x in numbers])/float(len(numbers)-1)\n",
    "    return math.sqrt(variance)\n",
    "\n",
    "def summarize(dataset):\n",
    "    summaries = [(mean(attribute), stdev(attribute)) for attribute in zip(*dataset)]\n",
    "    del summaries[-1]\n",
    "    return summaries\n",
    "\n",
    "def summarizeByClass(dataset):\n",
    "    separated = separateByClass(dataset)\n",
    "    summaries = {}\n",
    "    for classValue, instances in separated.items():\n",
    "        summaries[classValue] = summarize(instances)\n",
    "    return summaries\n",
    "\n",
    "def calculateProbability(x, mean, stdev):\n",
    "    if(stdev == 0):\n",
    "        stdev = 10000\n",
    "    exponent = math.exp(-(math.pow(x-mean,2)/(2*math.pow(stdev,2))))\n",
    "    return (1 / (math.sqrt(2*math.pi) * stdev)) * exponent\n",
    "\n",
    "def calculateClassProbabilities(summaries, inputVector):\n",
    "    probabilities = {}\n",
    "    for classValue, classSummaries in summaries.items():\n",
    "        probabilities[classValue] = 1\n",
    "        for i in range(len(classSummaries)):\n",
    "            mean, stdev = classSummaries[i]\n",
    "            x = inputVector[i]\n",
    "            probabilities[classValue] *= calculateProbability(x, mean, stdev)\n",
    "    return probabilities\n",
    "\n",
    "def predict(summaries, inputVector):\n",
    "    probabilities = calculateClassProbabilities(summaries, inputVector)\n",
    "    bestLabel, bestProb = None, -1\n",
    "    for classValue, probability in probabilities.items():\n",
    "        if bestLabel is None or probability > bestProb:\n",
    "            bestProb = probability\n",
    "            bestLabel = classValue\n",
    "    return bestLabel\n",
    "\n",
    "def getPredictions(summaries, testSet):\n",
    "    predictions = []\n",
    "    for i in range(len(testSet)):\n",
    "        result = predict(summaries, testSet[i])\n",
    "        predictions.append(result)\n",
    "    return predictions\n",
    "\n",
    "def getAccuracy(testSet, predictions):\n",
    "    correct = 0\n",
    "    for i in range(len(testSet)):\n",
    "        if testSet[i][-1] == predictions[i]:\n",
    "            correct += 1\n",
    "    return (correct/float(len(testSet))) * 100.0"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "def categoric_to_numeric(dataset):\n",
    "    copia = dataset\n",
    "    feature_list = []\n",
    "    for i in range(len(dataset[0])):\n",
    "        listE = []\n",
    "        feature_list.append(listE)\n",
    "        \n",
    "    for i in range(len(dataset[0])):\n",
    "        for j in dataset:\n",
    "            if(j[i] not in feature_list[i]):\n",
    "                feature_list[i].append(j[i])\n",
    "    for i in range(len(copia[0])):\n",
    "        for j in copia:\n",
    "            if(j[i] in feature_list[i]):\n",
    "                j[i] = feature_list[i].index(j[i])\n",
    "            \n",
    "    return copia"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[[0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 1, 0], [0, 0, 0, 0, 0, 2, 0], [0, 0, 0, 0, 1, 0, 0], [0, 0, 0, 0, 1, 1, 0], [0, 0, 0, 0, 1, 2, 0], [0, 0, 0, 0, 2, 0, 0], [0, 0, 0, 0, 2, 1, 0], [0, 0, 0, 0, 2, 2, 0], [0, 0, 0, 1, 0, 0, 0], [0, 0, 0, 1, 0, 1, 0], [0, 0, 0, 1, 0, 2, 0], [0, 0, 0, 1, 1, 0, 0], [0, 0, 0, 1, 1, 1, 0], [0, 0, 0, 1, 1, 2, 0], [0, 0, 0, 1, 2, 0, 0], [0, 0, 0, 1, 2, 1, 0], [0, 0, 0, 1, 2, 2, 0], [0, 0, 0, 2, 0, 0, 0], [0, 0, 0, 2, 0, 1, 0], [0, 0, 0, 2, 0, 2, 0], [0, 0, 0, 2, 1, 0, 0], [0, 0, 0, 2, 1, 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, 0, 0], [3, 3, 2, 0, 2, 1, 0], [3, 3, 2, 0, 2, 2, 0], [3, 3, 2, 1, 0, 0, 0], [3, 3, 2, 1, 0, 1, 1], [3, 3, 2, 1, 0, 2, 3], [3, 3, 2, 1, 1, 0, 0], [3, 3, 2, 1, 1, 1, 3], [3, 3, 2, 1, 1, 2, 2], [3, 3, 2, 1, 2, 0, 0], [3, 3, 2, 1, 2, 1, 3], [3, 3, 2, 1, 2, 2, 2], [3, 3, 2, 2, 0, 0, 0], [3, 3, 2, 2, 0, 1, 1], [3, 3, 2, 2, 0, 2, 3], [3, 3, 2, 2, 1, 0, 0], [3, 3, 2, 2, 1, 1, 3], [3, 3, 2, 2, 1, 2, 2], [3, 3, 2, 2, 2, 0, 0], [3, 3, 2, 2, 2, 1, 3], [3, 3, 2, 2, 2, 2, 2], [3, 3, 3, 0, 0, 0, 0], [3, 3, 3, 0, 0, 1, 0], [3, 3, 3, 0, 0, 2, 0], [3, 3, 3, 0, 1, 0, 0], [3, 3, 3, 0, 1, 1, 0], [3, 3, 3, 0, 1, 2, 0], [3, 3, 3, 0, 2, 0, 0], [3, 3, 3, 0, 2, 1, 0], [3, 3, 3, 0, 2, 2, 0], [3, 3, 3, 1, 0, 0, 0], [3, 3, 3, 1, 0, 1, 1], [3, 3, 3, 1, 0, 2, 3], [3, 3, 3, 1, 1, 0, 0], [3, 3, 3, 1, 1, 1, 3], [3, 3, 3, 1, 1, 2, 2], [3, 3, 3, 1, 2, 0, 0], [3, 3, 3, 1, 2, 1, 3], [3, 3, 3, 1, 2, 2, 2], [3, 3, 3, 2, 0, 0, 0], [3, 3, 3, 2, 0, 1, 1], [3, 3, 3, 2, 0, 2, 3], [3, 3, 3, 2, 1, 0, 0], [3, 3, 3, 2, 1, 1, 3], [3, 3, 3, 2, 1, 2, 2], [3, 3, 3, 2, 2, 0, 0], [3, 3, 3, 2, 2, 1, 3], [3, 3, 3, 2, 2, 2, 2]]\n"
     ]
    }
   ],
   "source": [
    "data_categoric = categoric_to_numeric(data)\n",
    "print(data_categoric)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [],
   "source": [
    "data_trtest = splitDataset(data_categoric,0.67)\n",
    "data_test = data_trtest[0]\n",
    "data_train = data_trtest[1]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [],
   "source": [
    "summarized_data = summarizeByClass(data_train)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [],
   "source": [
    "predictions = getPredictions(summarized_data, data_test)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[0, 3, 0, 0, 3, 1, 3, 0, 0, 0, 0, 3, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 3, 1, 3, 0, 0, 0, 1, 0, 3, 0, 0, 0, 0, 1, 0, 1, 0, 3, 0, 1, 0, 0, 0, 3, 1, 0, 0, 0, 1, 1, 1, 1, 3, 0, 1, 0, 3, 1, 0, 1, 1, 0, 0, 1, 0, 3, 1, 0, 0, 3, 0, 0, 0, 0, 0, 3, 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 3, 0, 1, 1, 1, 0, 1, 0, 3, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 3, 1, 1, 1, 0, 1, 0, 3, 0, 1, 0, 0, 1, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 1, 1, 0, 3, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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 1, 0, 0, 1, 0, 3, 3, 0, 1, 0, 1, 0, 3, 0, 0, 1, 0, 3, 0, 0, 0, 3, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 3, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 3, 1, 0, 0, 0, 0, 1, 1, 3, 0, 0, 3, 0, 3, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 3, 0, 3, 1, 1, 0, 1, 0, 1, 1, 0, 0, 0, 1, 0, 3, 0, 0, 1, 0, 1, 0, 1, 0, 3, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 3, 3, 0, 1, 3, 0, 0, 0, 0, 3, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 3, 1, 0, 0, 1, 0, 0, 1, 1, 0, 3, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 3, 0, 1, 3, 0, 1, 1, 0, 0, 0, 0, 3, 1, 1, 0, 3, 0, 1, 1, 0, 0, 0, 0, 0, 0, 3, 3, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 3, 0, 1, 1, 3, 0, 0, 0, 0, 0, 0, 3, 3, 0, 0, 0, 0, 0, 0, 3, 0]\n"
     ]
    }
   ],
   "source": [
    "print(predictions)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [],
   "source": [
    "accuracy_score2 = getAccuracy(data_test, predictions)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "80.03457216940363\n"
     ]
    }
   ],
   "source": [
    "print(accuracy_score2)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "As acurácias das 2 implementações são bastante próximas e a cada vez que são rodadas podem ser modificadas, ora a implementação do sklearn sendo maior quanto a que foi implementada"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
